var username = getCookie('username')

if (username) {
    console.log(username)
    document.querySelector('.head .common .left ul div').innerHTML = `<li><b>${username}</b></li><li><span onclick='logout()'>退出</span></li>`

}

function logout() {
    removeCookie('username')
    document.querySelector('.head .common .left ul div').innerHTML = ` <div>
    <li class="login"><a href="login.html">亲，请登录</a></li>
    <li><a href="">免费注册</a></li>
</div>`
}